Repository navigation
fix(dictation): drop the 2048-char llm_instruction cap the API no longer enforces - #319
Open
mayankbohradev wants to merge 2 commits into
Open
mayankbohradev wants to merge 2 commits into
mayankbohradev wants to merge 2 commits into
Conversation
…ger enforces DictationConfig rejected any llm_instruction over 2048 characters before sending, but the Dictation API accepts much longer instructions; only the whole config part is size-limited server-side. Leave the limit to the service, whose 400 already surfaces as DictationError. Fixes AssemblyAI#300
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
DictationConfigno longer rejects anllm_instructionlonger than 2048 characters. The limit is now left to the service.Why
Fixes #300. The SDK refused instructions the Dictation API accepts. The reporter measured lengths from 2,049 to 10,000 characters returning 200, and AssemblyAI's own re-probe in AssemblyAI/blurt#322 (18 Nov) found 2,049–49,152 characters accepted in both rewrite modes. In that probe the service limits only the size of the whole
configpart, and Blurt dropped its own cap. The public docs give caps forstt_promptandkeyterms_prompt, but none forllm_instruction.How
max_lengthfrom the field, along with the private_DICTATION_MAX_LLM_INSTRUCTION_LENconstant.DictationError.Testing
configpart whole, and a 400config part too largeraisesDictationError.pytest tests/unitpasses with pydantic v2 and on thepydantic.v1fallback.ruff checkandruff format --checkare clean on the changed files.Notes for reviewers
The Node SDK has the same cap (assemblyai-node-sdk#224).